class Result {
  static success(data = null, message = '操作成功') {
    return {
      code: 200,
      message,
      data
    };
  }

  static fail(message = '操作失败', data = null) {
    return {
      code: 0,
      message,
      data
    };
  }

  static unauthorized(message = '未登录或token已过期', data = null) {
    return {
      code: 401,
      message,
      data
    };
  }
}

module.exports = Result;